<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style type="text/css">
	label.col-2{width: 120px;}
	
	/*缩略图展示*/
	.uploader-blank{padding-top: 15px; width:158px;}
	.uploader-list{margin-bottom: 3px; position: relative;}
	.uploader-list img{height: 100px; width: 145px; border:#ccc 1px solid; padding: 3px;}
	.uploader-list .item{display: inline-block; text-align: center; position: relative; width: 157px;}
	.uploader-list .item .pic-box{border: #f0ecec 1px solid;}
	.uploader-list .item .state{position: absolute; bottom: -8px; text-align: center; background-color: #000; opacity: 0.6; color: #fff; padding: 1% 5%; width: 90%; overflow: hidden;}
	#filePicker{float: inherit;}

	/*附件列表*/
	.fujian{display: inline-block; width: auto;}
	.fujian li{list-style: none;  float: left; margin-right: 30px; position: relative; }
	.fujian li img{height: 100px;
    width: 100px;
    border: #ccc 1px solid;
    padding: 3px;}
	.fujian li i{ font-size: 22px;
    position: absolute;
    cursor: pointer;
    right: -7px;
    top: -12px;}
	.fujian li p{font-size: 12px; margin-left: 3px; line-height: 30px;}
	.fujianadd{
		    font-size: 100px;
    float: left;
    line-height: 92px;
	}
	
	
	#slimg{position: absolute; bottom: 0px; left: 0px; width: 100%; height: 30px;}

	.caozuo{}
	.caozuo span{cursor: pointer; margin-right: 10px;}

	
</style>
<title>产品编辑</title>
</head>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form1">
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>产品名称：</label>
			<label class="form-label col-6">
				<input type="text" class="input-text" value="" placeholder="" id="goods_name" name="goods_name" disabled>
			</label>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">副标题：</label>
			<div class="formControls col-6">
				<input type="text" class="input-text" value="" placeholder="" id="goods_brief" name="goods_brief" disabled>
			</div>
			<div class="col-3"> </div>
			<!-- <div class="btn btn-secondary-outline radius col-2">检测重复</div> -->
		</div>
		
		<div class="row cl">
			<label class="form-label col-2"><!-- <span class="c-red">*</span> -->所在地区：</label>
			<div class="formControls col-2"><input type="text" class="input-text" value="" id="goods_address" name="goods_address" disabled></div>
			<!-- <div class="formControls col-1"> 
				<span class="select-box">
					<select name="province" id="province" class="select">
						<option value="" selected="">全部分类</option>
					</select>
				</span> 
			</div>
			<div class="formControls col-1"> 
				<span class="select-box">
					<select name="city" id="city" class="select">
						<option value="" selected="">全部分类</option>
					</select>
				</span> 
			</div> -->
			
			<label class="form-label col-2">代理授权号：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" id="user_code" name="user_code" disabled>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-2"><!-- <span class="c-red">*</span> -->栏目：</label>
			<div class="formControls col-1"> 
				<input type="text" class="input-text" value="" placeholder="" id="gc_name" name="gc_name" disabled>
				<!-- <span class="select-box" id="gc_id1"> -->
					<!-- <select name="gc_id1" id="gc_id1" class="select">
						<option value="" selected="">全部分类</option>
					</select> -->
				<!-- </span>  -->
			</div>

			<label class="form-label col-2">到期日期：</label>
			<div class="formControls col-3">
				<input class="input-text" id="goods_date" type="text" name="goods_date" value="" disabled>
				
			</div>
			
			
			
		</div>

		
		
		<div class="row cl">
			<label class="form-label col-2"><!-- <span class="c-red">*</span> -->数量：</label>
			<div class="formControls col-1">
				<input type="text" class="input-text" value="" placeholder="" id="goods_num" name="goods_num" disabled>
			</div>

			<div class="formControls col-1">
				<input class="input-text" size="1" name="unit" id="unit" placeholder="包" disabled>
			</div>
			<div class="col-2"></div>
		</div>

		<div class="row cl">
			<label class="form-label col-2"><!-- <span class="c-red">*</span> -->原价：</label>
			<div class="formControls col-2">
				¥
				<input type="text" class="input-text" value="" placeholder="" id="goods_price" name="goods_price" disabled style="width: 165px;">
				<span id="selectsort"></span>
			</div>

			<div class="col-2"></div>
			<label class="form-label col-2">置换券数：</label>
			<div class="formControls col-1">
				<input type="text" class="input-text" value="" placeholder="" id="goods_quan" name="goods_quan" disabled>
			</div>
			<div class="col-2"></div>
		</div>
		<!-- <div class="row cl">
			<label class="form-label col-2">当前状态</label>
			<div class="col-3 s-msg caozuo" id="state">
			
				
			     
			</div>
		</div> -->
		<!-- <div class="row cl">
			<label class="form-label col-2">收货情况</label>
			<div class="formControls col-3 s-msg">
			    <div class="radio-box">
			        <input type="radio" id="sign-1" name="goods_sign" value="0" checked>
			        <label for="sign-1" class="lh-26">未发货</label>
			    </div>
			    <div class="radio-box">
			        <input type="radio" id="sign-2" name="goods_sign" value="1">
			        <label for="sign-2" class="lh-26">已发货</label>
			    </div>
			    <div class="radio-box">
			        <input type="radio" id="sign-3" name="goods_sign" value="2">
			        <label for="sign-3" class="lh-26">确认收货</label>
			    </div>
			</div>
		</div>	 -->
		
		<div class="row cl">
			<label class="form-label col-2">上架</label>
			<div class="formControls col-3 s-msg">
			   
			    <label class="c-warning" id="goods_show">显示</label>
			    
			</div>
			
		</div>	
			
		

		<div class="row cl">
			<label class="form-label col-2">产品图片：</label>
			<div class="formControls col-10" >
				
				<span class="l mb-10 fujian" id="fujian">

				</span>
				<!-- <i class="Hui-iconfont fujianadd" onclick="_open('添加附件','article-imageupload.html?type=image&idname=fujian&api=goods&single=0&inputname=goods_images2','750px','470px',true)">&#xe610;</i> -->

	
				
	
			</div>
		</div>
		
		
		<div class="row cl">
			<label class="form-label col-2">文章内容：</label>
			<div class="formControls col-10"> 
				<script id="editor" name="goods_info" type="text/plain" ></script> 
			</div>
		</div>
		

		
</div>

<!-- <div class="row cl pr-20" style="position:fixed; bottom:10px; width: 200px; right: 10px; text-align: right; z-index:1000; ">
	
		<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
		<button onClick="removeIframe();" class="btn btn-default radius" type="button" style="margin-left:10px;">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
	
</div> -->
</form>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 

<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 

<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 


<script type="text/javascript">
var gc_id1,gc_id2;//分类


function removeIframe(){
	var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}

// 添加时间默认当前时间
$("#goods_date").val(getNowTime());

function sortchange(){
	var strvalue=$("#sort").val();
	$("#selectsort").text("/"+strvalue);
}

$(function(){

	
	

	$("#form1").attr("action", API_GOODS); 

	var editid=getUrlParam('editid');//编辑菜单id


	// 商品操作、审核/确认收货
	$(document).on('click','span.pagefun-shenhe',function(){
	    var id=editid;
	    var that=$(this);
	    var flag=that.data("flag");
	    $.getJSON(API_GOODS,{pending:id,t1:flag},function(data){
	    	checkStatus(data);
	        if(data.status==1){
	        	if(flag==1){
	        		that.parent().html("审核通过");
	        	}else if(flag==0){
	        		that.parent().html("审核不通过");
	        	}
	        	
            }
	    });  
	})

	if(editid!==null){	     
	    var eidturl=API_APPLYLIST+"?aid="+editid;
	    // 读取即将编辑的文章信息
	    $.getJSON(eidturl,function(data){

	    	if(!checkStatus(data)) return;//判断登录

	    	if(data.datas==''){
	    		layer.msg("数据加载错误", {icon:2,time:1000});
	    	}else{
	            $("#goods_name").val(data.datas.goods_name);
	            $("#goods_address").val(data.datas.address);
	            $("#gc_name").val(data.datas.gc_name);
	            $("#user_code").val(data.datas.user_code);
	            $("#goods_price").val(data.datas.goods_price);
	            $("#goods_num").val(data.datas.goods_num);
	            $("#goods_quan").val(data.datas.goods_quan);
	            $("#unit").val(data.datas.goods_unit);

	            $("#goods_date").val(data.datas.goods_date);
	            $("#form1").attr("action", eidturl);
	            
	            
	            
	             var goods_images=data.datas.goods_images;
        	for (x in goods_images){
        		$('#fujian').show();
        	   	$('#fujian').append('<li><img src="'+getIcon(goods_images[x])+'"></li>');	
        	}


                
	            gc_id1=  data.datas.gc_id1; //分类1
	            gc_id2=  data.datas.gc_id2; //分类2
	         
	            UE.getEditor('editor').addListener('ready', function (editor) {
		            UE.getEditor('editor').setContent(data.datas.goods_info);
	            });


	            
	            
	            if(data.datas.goods_show=='0'){
	                $("#goods_show").text("下架")
	            }else{
	                $("#goods_show").text("上架")
	            }

	            // if(data.datas.goods_state=='0'){
	            // 	$("#state").html("审核不通过")
	                
	            // }else if(data.datas.goods_state=='1'){
	            //     $("#state").html("审核通过")
	            // }else if(data.datas.goods_state=='2'){
	            // 	// 等待审核
	            // 	$("#state").html('<span class="label radius pagefun-shenhe" data-flag="1">通过</span><span class="label radius pagefun-shenhe" data-flag="0" >不通过</span>');
	            // }else if(data.datas.goods_state=='3'){
	            // 	// $("#state").html("已发货")
	            // 	$("#state").html('<span class="label radius pagefun-shenhe" data-flag="4">确认收货</span>');
	            // }else if(data.datas.goods_state=='4'){
	            // 	$("#state").html("已确认收货")
	            // }
	 
	        }
	    })
	}



	Validformsubmit("#form1");

	
	
	
	
	
	// 富文本编辑器
	getueidt()


});


// 移除选中的图片
function fj_close(obj){
	$(obj).parents("li").remove();
}


</script>
</body>
</html>